import React, { Component, Fragment } from 'react';
import { GlobalStyle } from './style.js'
import Header from './common/header'

import Home from './pages/home'
import Explore from './pages/explore'
import Question from './pages/question'
import Detail from './pages/home/detail'

import store from './store'
import { Provider } from 'react-redux'
import { GlobalIconFont } from './static/iconfont/iconfont.js';
import { HashRouter, Route } from 'react-router-dom'

class App extends Component {

  render() {
    return (
      <Fragment>
        <GlobalStyle />
        <GlobalIconFont />
        <Provider store={store}>
          <HashRouter>
            <Header />
            <Route path='/' exact component={Home} />
            <Route path='/home/detail/:id' component={Detail} />
            <Route path='/explore' component={Explore} />
            <Route path='/question' component={Question} />
          </HashRouter>
        </Provider>
      </Fragment>
    )
  }
}

export default App;
